import pandas as pd
# 测试数据
df1 = pd.DataFrame({
    'A': [1,2],
    'B': [3,4]
}, index=['a','b'])

df2 = pd.DataFrame({
    'C': [5,6],
    'D': [7,8]
}, index=['b','c'])

# 测试用例1：外连接合并
result_outer = pd.concat([df1, df2], axis=1, join='outer')
print('外连接合并结果:\n', result_outer)

# 测试用例2：内连接合并
result_inner = pd.concat([df1, df2], axis=1, join='inner')
print('内连接合并结果:\n', result_inner)

# 测试用例3：索引对齐验证
df3 = pd.DataFrame({'E': [9]}, index=[100])
result_index = pd.concat([df1, df3], axis=1)
print('索引对齐验证结果:\n', result_index)
